import request from '@/utils/request'

// 查询实践预约列表
export function listPracticeAppointment(query) {
  return request({
    url: '/training/practiceAppointment/list',
    method: 'get',
    params: query
  })
}

// 查询实践预约详细
export function getPracticeAppointment(practiceAppointmentId) {
  return request({
    url: '/training/practiceAppointment/' + practiceAppointmentId,
    method: 'get'
  })
}

// 新增实践预约
export function addPracticeAppointment(data) {
  return request({
    url: '/training/practiceAppointment',
    method: 'post',
    data: data
  })
}

// 修改实践预约
export function updatePracticeAppointment(data) {
  return request({
    url: '/training/practiceAppointment',
    method: 'put',
    data: data
  })
}

// 删除实践预约
export function delPracticeAppointment(practiceAppointmentId) {
  return request({
    url: '/training/practiceAppointment/' + practiceAppointmentId,
    method: 'delete'
  })
}

// 修改实践预约(分配班级)
export function editPracticeAppointment(data) {
  return request({
    url: '/training/practiceAppointment/editPracticeAppointment',
    method: 'put',
    data: data
  })
}
// 修改实践预约(分配班级)
export function removePracticeAppointment(practiceAppointmentId) {
  return request({
    url: '/training/practiceAppointment/removePracticeAppointment/' + practiceAppointmentId,
    method: 'delete'
  })
}

// 条件查询实践预约列表
export function selectListByQuery(query) {
  return request({
    url: '/training/practiceAppointment/selectListByQuery',
     method: 'get',
     params: query
  })
}

// 新增实践预约(分配班级)
export function insertPracticeAppointment(query) {
  return request({
    url: '/training/practiceAppointment/insertPracticeAppointment',
     method: 'post',
     data: query
  })
}

// 通过班级id查询实践预约列表
export function selectListByClassId(classId) {
  return request({
    url: '/training/practiceAppointment/selectListByClassId/'+classId,
     method: 'get',
  })
}
